/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package net.wofly.right.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import net.wofly.right.domain.ReceivingAddr;

public interface ReceivingAddrRepository
        extends PagingAndSortingRepository<ReceivingAddr, String>, JpaSpecificationExecutor<ReceivingAddr> {

    List<ReceivingAddr> findByUserID(String userID);

    List<ReceivingAddr> findByUserIDAndStatusOrderByDefaultFlagDesc(String userID, Integer status);
    
    List<ReceivingAddr> findByUserIDAndDefaultFlagAndStatus(String userID, Integer defaultFlag, Integer status);
    
    Integer countByUserIDAndStatus(String userID, Integer status);
}